<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div,
      p {
        border: solid;
      }
    </style>
  </head>
  <body>
    <div id="box">content</div>
    <script>
      // dom树上的节点
      const box = document.getElementById("box");

      // <div> <p>
      const div = document.createElement("div");
      const p = document.createElement("p");
      
      const t1 = document.createTextNode("hello div");
      const t2 = document.createTextNode("hello p");
      div.append(t1);
      p.append(t2);

      box.append(div, p);
    </script>
  </body>
</html>
